import { ImagesConst } from "../../../resource/ImagesConst";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { Vector } from "../../../../../__AS3__/vec/Vector";
type int = number;
//class PetEquipStars
    
    export  class PetEquipStars /* flash.display.Sprite */
    {
        constructor()
        {
            
            this._starVec = new Vector.<flash.display.Bitmap>();
            this.initUI();
            return;
        }

        /* internal  */initUI(): void
        {
            var loc1=0;
            var loc2=null;
            loc1 = 0;
            while (loc1 < 10) 
            {
                loc2 = new Object /* flash.display.Bitmap */();
                loc2.x = loc1 * 18;
                this.addChild(loc2);
                this._starVec.push(loc2);
                ++loc1;
            }
            return;
        }

        public set starNum(arg1: int)
        {
            this._starNum = arg1;
            this.updateStars();
            return;
        }

        public set starMode(arg1: string)
        {
            this._starMode = arg1;
            this.updateStarsPosition();
            this.updateStars();
            return;
        }

        /* internal  */updateStars(): void
        {
            var loc3=0;
            var loc1=this._starMode != PetEquipStars.StarBig ? ImagesConst.littleStar_light : ImagesConst.littleStar_big;
            var loc2=this._starMode != PetEquipStars.StarBig ? ImagesConst.littleStar_gray : ImagesConst.littleStar_bigGray;
            loc3 = 0;
            while (loc3 < this._starVec.length) 
            {
                if (loc3 < this._starNum) 
                {
                    this._starVec[loc3].bitmapData = GlobalClass.getBitmapData(loc1);
                }
                else 
                {
                    this._starVec[loc3].bitmapData = GlobalClass.getBitmapData(loc2);
                }
                ++loc3;
            }
            return;
        }

        /* internal  */updateStarsPosition(): void
        {
            var loc1=0;
            loc1 = 0;
            while (loc1 < this._starVec.length) 
            {
                if (this._starMode != PetEquipStars.StarBig) 
                {
                    this._starVec[loc1].x = loc1 * 18;
                }
                else 
                {
                    this._starVec[loc1].x = loc1 * 23;
                }
                ++loc1;
            }
            return;
        }

        public static /* const */StarBig: string="PetEquipStars.StarBig";

        public static /* const */StarSmall: string="PetEquipStars.StarSmall";

        /* internal */ /* var */_starMode: string="PetEquipStars.StarSmall";

        /* internal */ /* var */_starNum: int;

        /* internal */ /* var */_starVec: Vector.<flash.display.Bitmap>;
    }
